# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-sport-activities-features
pkgver=0.4.0
pkgrel=1
pkgdesc="A minimalistic toolbox for extracting features from sport activity files"
url="https://github.com/firefly-cpp/sport-activities-features"
arch="noarch"
license="MIT"
depends="
	python3
	py3-geopy
	py3-geotiler
	py3-gpxpy
	py3-matplotlib
	py3-niaaml
	py3-overpy
	py3-tcx2gpx
	py3-tcxreader
	"
checkdepends="py3-pytest"
makedepends="py3-gpep517 py3-poetry-core"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/firefly-cpp/sport-activities-features/archive/$pkgver/sport-activities-features-$pkgver.tar.gz"
builddir="$srcdir/sport-activities-features-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	# exclude network tests
	python3 -m pytest -k "not test_weather and not overpy_node_manipulation and not test_data_analysis and not test_missing_elevation_identification"
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/sport_activities_features-$pkgver-py3-none-any.whl

	install -Dm644 docs/preprints/A_minimalistic_toolbox.pdf -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 CITATION.cff -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
8766f1b5f8c3daba044aab26d8369a4342a80bb58a3abbf04a98ab846bebcef8e90d96b070f8f894a3af8796e246e7a4ce43a3a680c0c4d22cba2104fba5073e  sport-activities-features-0.4.0.tar.gz
"
